The invention relates to determining a depth.
Determining a depth or a distance, also known as range sensing, is important in, e.g., industrial applications such as measurement of solder paste volume in manufacturing surface-mounted electronic assemblies, digitization of three-dimensional (xe2x80x9c3-Dxe2x80x9d) clay models, and inspection of semiconductor packages for lead coplanarity.
Electronic devices that have traditional electrical terminals (e.g., dual in-line package leads) may be inspected in two dimensions using backlight. However, some devices that have other types of electrical terminals such as ball grid array balls cannot be effectively inspected using backlight. Instead these devices are inspected by an imaging system that can view the terminals in three dimensions to check for compliance with specifications for, e.g., height, volume, and shape.
Optical systems have been devised that allow 3-D images to be derived from two-dimensional (xe2x80x9c2-Dxe2x80x9d) images, by exploiting optical principles that relate the extent to which a surface is out-of-focus to a distance between the surface and an in-focus point. With such systems, resulting depth information in each of the derived 3-D images has only a fraction of the resolution of each of the 2-D images (e.g., only 512xc3x97512 points of depth information from 1024xc3x971024 2-D images). Thus, to derive depth information having only moderate resolution, such systems are compelled to use costly high-resolution cameras that can produce the necessary high-resolution 2-D images.
In general, in one aspect, the invention features a method for deriving a three-dimensional image from two-dimensional images, at least one of the two-dimensional images having a predetermined number of pixels. The method includes: deriving focus-based depth measurements from the two-dimensional images, the number of derived focus-based depth measurements being substantially equal to the predetermined number of pixels; and from the two-dimensional digital images and the depth measurements, deriving the three-dimensional image.
Implementations of the invention may include one or more of the following features. The method may further include deriving a focus measurement for each pixel in the predetermined number of pixels. The method may further include deriving each focus-based depth measurement from the focus measurements. The three-dimensional image may include information about a subject and each of the two-dimensional images may include different information about the subject. The method may further include imposing structured illumination on the subject and producing the two-dimensional images from the subject under the structured illumination. The method may further include, for each of the two-dimensional images, imposing different structured illumination on the subject. Each instance of imposed structured illumination may include a same pattern having a spatial period, and, for the instances of imposed structured illumination, the respective positions of the pattern relative to the subject may differ by a fraction of the spatial period. The fraction may include a multiple of a quarter of the spatial period. The subject may bear a contrast pattern, and the method may further include, in the derivation of the focus-based depth measurements, excluding at least some information about the contrast pattern.
In general, in another aspect, the invention features a method for use in determining a depth. The method includes taking three sample values of a characteristic of an area defined by a pixel, each sample value corresponding to a different position of structured illumination relative to the area.
Implementations of the invention may include one or more of the following features. The structured illumination may include a pattern having a spatial period, and each of the different positions may differ by a fraction of the spatial period. The method may further include, from the three sample values, deriving a computed value representing a result of illuminating the area with unstructured illumination. The method may further include, from the three sample values and the computed value, deriving normalized sample values representing respective results of illuminating the area with the structured illumination at positions differing by the fraction of the spatial period. The method may further include, from the normalized sample values, deriving a focus measure representing a relative distance. The spatial period may be at least as long as four times a length defined by the pixel.
In general, in another aspect, the invention features a method for use in processing a digital image. The method includes: imposing structured illumination on a subject, producing two-dimensional images from the subject under the structured illumination, at least one of the two-dimensional images having a predetermined resolution, each of the two-dimensional images including different information about the subject, from the two-dimensional digital images, deriving focus measurements, from the focus measurements, deriving depth measurements, and from the two-dimensional digital images and the depth measurements, deriving a three-dimensional image having the predetermined resolution.
In general, in another aspect, the invention features a method for use in determining a depth. The method includes: taking three sample values of a characteristic of an area defined by a pixel, each sample value corresponding to a different position of structured illumination relative to the area, the structured illumination including a pattern having a spatial period, each of the different positions differing by a fraction of the spatial period; from the three sample values, deriving a computed value representing a result of illuminating the area with unstructured illumination; from the three sample values and the computed value, deriving normalized sample values representing respective results of illuminating the area with the structured illumination at positions differing by the fraction of the spatial period; and from the normalized sample values, deriving a focus measure representing a relative distance.
Among the advantages of the invention are one or more of the following. A CCD sensor having a 512xc3x97512 pixel array can be used to produce a 512xc3x97512 depth image (i.e., 512xc3x97512 points of depth information). With little or no modification to hardware, some existing systems for producing depth images can be upgraded to produce higher-resolution depth images. A depth image can be created by using a simple patterned mask that changes sinusoidally from dark to light. Large groups of electrical terminals can be effectively inspected by using conventional CCD sensors.
Other advantages and features will become apparent from the following description and from the claims.